package com.wangzhixuan.service.impl;

import java.io.Serializable;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.wangzhixuan.mapper.UserMapper;
import com.wangzhixuan.model.User;

@Service
public class TestService {
	@Autowired
	private UserMapper userMapper;

	protected Logger logger = LogManager.getLogger(getClass());

	@Cacheable(value = "oneMin", key = "#id")
	public User selectById(Serializable id) {

		logger.debug("Get user id = " + id);
		return userMapper.selectById(id);
	}
}
